home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 229 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.0 KB  |  45 lines

  1. Path: thor.tu.hac.com!collins
  2. From: collins@thor.tu.hac.com (Ron Collins)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Prototypes
  5. Date: 3 Jan 1996 14:21:38 GMT
  6. Organization: Advanced Depot Systems
  7. Message-ID: <4ce3di$4j9@hacgate2.hac.com>
  8. References: <jason_gredley.5.30EA3371@mindlink.bc.ca>
  9. NNTP-Posting-Host: thor.tu.hac.com
  10.  
  11. Jason Gredley (jason_gredley@mindlink.bc.ca) wrote:
  12. :     Formerly I have been programing in C++.  Recently however I thought I 
  13. : should at least do a few programs in C, if for nothing else, ability to say 
  14. : that I can program in C.  Normally in C++ I would include appropriate header 
  15. : files and then at any point be free to call those functions included in that 
  16. : header file.  However when compiling a C program the compiler is generating a 
  17. : zillion _warnings_ of "call to function with no prototype".  Looking at C 
  18. : example programs, etc it seems customary to identify prototypes at the top of 
  19. : a module as well as including header files (this seems redundant).  I am even 
  20. : getting the same warning about calling strcpy (a library function) after 
  21. : including the "string.h" header; am I suppose to have prototypes for every 
  22. : function I call?  At present I am not bothering to have prototypes at the 
  23. : beginning of my program modules but am including header files (my program is 
  24. : not exhibiting problems of any sort).  I want to know specifically if there 
  25. : is any reason that I should have these prototypes in each module or at least 
  26. : what the signifigance this has to a C program and why it has none to C++.
  27.  
  28. : Thanx ... Jason
  29.  
  30. The style of placing #include files at the top of a source code file is
  31. the same between C and C++.  If you are getting a zillion warnings, then 
  32. the problem lies elsewhere.  Post a complete working snippet of code
  33. that generates the warnings you are talking about.
  34.  
  35.  
  36.                         -- Collins --
  37.                         
  38. -----
  39. The views expressed here are mine alone.
  40.  
  41. Ron Collins/Hughes Aircraft Company/M20,P20/Tucson Az 85706
  42. rcollins@thor.tu.hac.com    collins@seagull.rtd.com
  43. ยก----
  44.  
  45.